#ifndef DVDEFINITIONS_H
#define DVDEFINITIONS_H

#include <QtGui>
#include <QtSql>
#include <QMessageBox>
#include <QtXml/QDomDocument>
#include <qwt_plot_canvas.h>
#include <qwt_legend.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_curve.h>
#include <qwt_symbol.h>
#include <qwt_plot_marker.h>
#include <qwt_scale_draw.h>
#include <qwt_scale_div.h>
#include <qwt_column_symbol.h>
#include <qwt_plot_histogram.h>
#include <qwt_legend_item.h>
#include <qwt_plot_layout.h>
#include <qwt_plot_renderer.h>
#include "dvFunctions.h"

using namespace dv_global_functions;

// DATABASE SETTINGS

#define DV_DB_CONN "DATAVIEWER2012"
#define DV_DB_TYPE "QSQLITE"
#define DV_DB_HOST ""

#ifdef QT_DEBUG
#define DV_DB_NAME "../DB/dataviewer.db"
#define DV_MAPS_PATH "../DataViewer/maps/"
#else
#define DV_DB_NAME "data/dataviewer.db"
#define DV_MAPS_PATH "maps/"
#endif

#define DV_DB_USER ""
#define DV_DB_PASS ""

// END DB SETTINGS

#define DV_PLAY_SPEED_MLS 4000

enum DV_MAP_OBJECT_DATA
{
    OBJECT_ID, OBJECT_NAME
};

enum DV_TABS
{
    TAB_DATA_TABLE, TAB_MAP, TAB_LINE_CHART, TAB_HISTOGRAM, TAB_PIE_CHART, TAB_BUBBLE_CHART
};

enum DV_EXPORT_FORMATS
{
    EXPORT_CSV, EXPORT_XLS
};

#define DV_DATE_FORMAT "yyyy-MM-dd"
#define CSV_BASE_DATE_FORMAT "dd.MM.yyyy"

#define DV_MIN_COLS 2
#define DV_MIN_ROWS 0

enum DV_TABLE_MAIN
{
    MAIN_TABLE_DATA, MAIN_TABLE_REGION, MAIN_TABLE_INDICATOR /* 1 ... MAIN_TABLE_INDICATOR N */
};

enum DV_TABLE_MAPS
{
    MAPS_ID, MAPS_NAME, MAPS_FILE
};

enum DV_TABLE_REGIONS
{
    REGIONS_ID, REGIONS_MAP, REGIONS_NAME, REGIONS_AREA
};

struct DV_REGION
{
    QVariant id;
    QVariant name;
    QVariant area;
};

enum DV_TABLE_INDICATORS
{
    INDICATORS_ID, INDICATORS_NAME, INDICATORS_UNITS, INDICATORS_INFO
};

struct DV_INDICATOR
{
    QVariant id;
    QVariant name;
    QVariant unit;
    QVariant info;
};

enum DV_TABLE_DATA
{
    DATA_DATE, DATA_REGION, DATA_REGION_NAME, DATA_INDICATOR, DATA_INDICATOR_NAME, DATA_VALUE
};

struct DV_DATA
{
    QVariant date;
    QVariant region;
    QVariant regionName;
    QVariant indicator;
    QVariant indicatorName;
    QVariant value;
};

enum DV_TABLE_SYNONYMS
{
    SYNONYMS_ID, SYNONYMS_REGION, SYNONYMS_SYNONYM
};

// END TABLE FIELDS

// FOR CHECK ROWS DATA

enum DV_CHECK_DATA
{
    CHECK_INCORRECT, CHECK_NO_CHANGED, CHECK_CHANGED
};

// END CHECK


#endif // DVDEFINITIONS_H
